package com.fresher.model;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;

/**
 * The persistent class for the transaction database table.
 * 
 */
@Entity
//@NamedQuery(name="Transaction.findAll", query="SELECT t FROM Transaction t")
public class Transaction implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int idtransaction;

	private int afterBalance;

	private int amount;

	private int beforeBalance;

	@Temporal(TemporalType.TIMESTAMP)
	private Date date;

	public Transaction(int afterBalance, int amount, int beforeBalance,
			Date date, String description) {
		super();
		this.afterBalance = afterBalance;
		this.amount = amount;
		this.beforeBalance = beforeBalance;
		this.date = date;
		this.description = description;
		
	}

	private String description;

	//bi-directional many-to-one association to Accountinfo
	@ManyToOne
	@JoinColumn(name="accountid")
	private Accountinfo accountinfo1;

	//bi-directional many-to-one association to Accountinfo
	@ManyToOne
	@JoinColumn(name="accountIDTo")
	private Accountinfo accountinfo2;

	public Transaction() {
	}

	public int getIdtransaction() {
		return this.idtransaction;
	}

	public void setIdtransaction(int idtransaction) {
		this.idtransaction = idtransaction;
	}

	public int getAfterBalance() {
		return this.afterBalance;
	}

	public void setAfterBalance(int afterBalance) {
		this.afterBalance = afterBalance;
	}

	public int getAmount() {
		return this.amount;
	}

	public void setAmount(int amount) {
		this.amount = amount;
	}

	public int getBeforeBalance() {
		return this.beforeBalance;
	}

	public void setBeforeBalance(int beforeBalance) {
		this.beforeBalance = beforeBalance;
	}

	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Accountinfo getAccountinfo1() {
		return this.accountinfo1;
	}

	public void setAccountinfo1(Accountinfo accountinfo1) {
		this.accountinfo1 = accountinfo1;
	}

	public Accountinfo getAccountinfo2() {
		return this.accountinfo2;
	}

	public void setAccountinfo2(Accountinfo accountinfo2) {
		this.accountinfo2 = accountinfo2;
	}

}